home *** CD-ROM | disk | FTP | other *** search
/ Mac Mania 6 / MacMania 6.toast / / Tools&Utilities / TouchMe 1.2□ / touchMe 1.2 Folder / touchMe source codes / CW11 PP source / source / Common Lib / CPrefsFile.h < prev    next >
Encoding:
Text File  |  1997-04-25  |  1.5 KB  |  66 lines  |  [TEXT/CWIE]

  1. // ==================================================
  2. //    CPrefsFile.h
  3. //    Copyright (C) 1996-1997 Mizutori Tetsuya
  4. //    July 4, 1996; February 3, 1997; March 14, 1997.
  5. // ==================================================
  6. //    All documents are pretty-printed in 10-point Geneva font.
  7.  
  8. #pragma once
  9.  
  10. #include <LPreferencesFile.h>
  11.  
  12.  
  13. class    CPrefsFile : public LPreferencesFile {
  14.  
  15. public:
  16.     // Create a FSSpec for the preferences file placed in the Preferences folder
  17.                     CPrefsFile();
  18.                     CPrefsFile( ConstStr255Param inFileName,
  19.                                 OSType inPrefFileCreator );
  20.     virtual             ~CPrefsFile();
  21.  
  22. protected:
  23.  
  24.     // Setup constants at startup.
  25.     void                SetupConstants( void );
  26.  
  27.     void                SetupFileInfo(
  28.                         OSType        inPrefFileType,
  29.                         OSType        inPrefFileCreator );
  30.  
  31.     void                SetupResType(
  32.                         ResType        inPrefResType,
  33.                         ResIDT        inPrefResID );
  34.  
  35.     // Read a block data from the preferences file
  36.     OSErr            LoadPrefs(
  37.                         long &        outBlockDataLen,
  38.                         Handle        outBlockDataH );
  39.  
  40.     OSErr            LoadPrefs(
  41.                         long &        outBlockDataLen,
  42.                         Handle        outBlockDataH,
  43.                         ResType        inPrefResType,
  44.                         ResIDT        inPrefResID );
  45.  
  46.     // Write a block data to the preferences file
  47.     OSErr            SavePrefs(
  48.                         long            inBlockDataLen,
  49.                         Handle        inBlockDataH );
  50.  
  51.     OSErr            SavePrefs(
  52.                         long            inBlockDataLen,
  53.                         Handle        inBlockDataH,
  54.                         ResType        inPrefResType,
  55.                         ResIDT        inPrefResID );
  56.  
  57. private:
  58.  
  59.     OSType            mPrefFileType;        // 'pref'
  60.     OSType            mPrefFileCreator;    // 'MzTm'
  61.     ResType            mPrefResType;        // 'PREF'
  62.     ResIDT            mPrefResID;        // 1000
  63. };
  64.  
  65. // end of definitions
  66.